﻿//Dùng tại frmNhapVeHuy_DL

using System;
using System.Data;
using System.Data.SqlClient;
using DevExpress.XtraReports.UI;
using prjKQXS_DLL;
using prjKQXS_DLL.Truyen_thong;

namespace prjKQXS_Report.Truyen_thong
{
    public partial class rptTongHopCTTT : DevExpress.XtraReports.UI.XtraReport
    {
        public DataTable dtSource;
        public string TyLe = "";

        public rptTongHopCTTT()
        {
            InitializeComponent();
        }

        private void rptTonghopcttt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            lblNgay.Text = ((DateTime)pNgay.Value).ToString("dd/MM/yyyy");
            xrlblDonVi.Text = "Phòng XSKT: " + pTenDV.Value;
            txtMaso.Text = pMaCB.Value.ToString();
            txtNguoiquanly.Text = pTenCB.Value.ToString();
            lblHT.Text = TyLe;

            Report_DAL report_dal = new Report_DAL();
            dsReports dsReports1 = new dsReports();
            dsReports1 = report_dal.reportDungChung(dsReports1);

            dsReports1.Tables.Remove("TruyenThong");
            dsReports1.Tables.Add(dtSource);
            this.DataSource = dsReports1;
            this.DataMember = "TruyenThong";
        }

        int flag = 0;
        decimal htDetails = 0;
        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            flag++;
            htDetails += (decimal)clsCommon.Parse(lblHT1.Text, 3);
        }
    }
}
